package com.yxq.mdt.app.modules.auction.ui;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.orhanobut.hawk.Hawk;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.base.BaseActivity;
import com.yxq.mdt.app.constant.SPKey;
import com.yxq.mdt.app.modules.auction.model.AuctionModel;
import com.yxq.mdt.app.modules.main.bean.NameAndPhoneBean;
import com.yxq.mdt.app.modules.pm.ui.PmGoodsDetailTabVerticalActivity;
import com.yxq.mdt.app.net.ApiModel;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 预备团长说明
 */
public class PreLeaderIntroActivity extends BaseActivity {


    @BindView(R.id.become_team_leader)
    TextView becomeTeamLeader;
    @BindView(R.id.tv_gift_number)
    TextView tvGiftNumber;

    @Override
    public int getLayoutId() {
        return R.layout.activity_pre_leader_intro;
    }

    @Override
    public void initView() {
        status();
    }

    private void status() {
        AuctionModel.getGiftNumber(new ApiModel.CommonCallback<String>() {
            @Override
            public void onSuccess(String s) {
                tvGiftNumber.setText("您当前累计直推精品区商品：" + s + "个");
            }

            @Override
            public void onError(String errMsg) {

            }
        });
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {

    }

    @OnClick(R.id.become_team_leader)
    public void onViewClicked() {
        NameAndPhoneBean nameAndPhoneBean = Hawk.get(SPKey.SP_KEY_NAME_PHONE_INFO);
        Intent intent = new Intent(mActivity, PmGoodsDetailTabVerticalActivity.class);
        intent.putExtra("id", nameAndPhoneBean.getPmSetting().getGift_goods_id());
        startActivity(intent);
    }

}
